<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>管理员列表 - 领导日程说明系统</title>
    <meta th:replace="~{include/all_include ::  title}"/>
    <link
            th:href="@{/common/resource/H-ui.admin/static/h-ui.admin/css/H-ui.login.css}"
            rel="stylesheet" type="text/css"/>
    <meta name="keywords" content="领导日程说明系统-登录">
    <meta name="description" content="领导日程说明系统-登录">
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span>用户模块
    <span class="c-gray en">&gt;</span> 管理员列表
    <a class="btn btn-success radius r" style="line-height: 1.6em; margin-top: 3px"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <form th:action="@{/back/adminsBack/adminsList}" method="post">
        <div class="text-c">
            <input type="text" name="keyword" id="" th:value="${paramQuery.keyword }" placeholder="请输入关键字"
                   style="width: 250px" class="input-text">
            <span class="select-box inline">
                状态:
                <select name="entity.status" class="select">
                    <option value="">请选择</option>
                    <th:block th:each="enumsTemp: ${enumsOne?.enumsJson.getJSONArray('STATUS')}">
                        <option th:value="${enumsTemp.code}" th:selected="${paramQuery.entity.status == enumsTemp.code}">
                            <th:block th:text="${enumsTemp.info}"/>
                        </option>
                    </th:block>
                </select>
            </span>
            <span class="select-box inline">
                删除标识:
                <select name="entity.delFlag" class="select">
                    <option value="">请选择</option>
                    <th:block th:each="enumsTemp: ${enumsOne?.enumsJson.getJSONArray('DELFLAG')}">
                        <option th:value="${enumsTemp.code}" th:selected="${paramQuery.entity.delFlag == enumsTemp.code}">
                            <th:block th:text="${enumsTemp.info}"/>
                        </option>
                    </th:block>
                </select>
            </span>
            日期范围：
            <input type="text" readonly="readonly" th:value="${stDate }"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                   name="stDate" class="input-text Wdate" style="width: 170px;">
            - <input type="text" readonly="readonly" th:value="${edDate }"
                     onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                     name="edDate" class="input-text Wdate" style="width: 170px;">
            <button name="" id="" class="btn btn-success" type="submit">
                <i class="Hui-iconfont">&#xe665;</i> 搜索
            </button>
        </div>
    </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <!--<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius">
                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除
            </a>-->
            <a class="btn btn-primary radius" data-title="添加管理员"
               th:data-href="@{/back/adminsBack/adminsInsert}" onclick="Hui_admin_tab(this)"
               href="javascript:;">
                <i class="Hui-iconfont">&#xe600;</i> 添加管理员
            </a>
        </span>
        <span class="r">
            共有数据：<strong th:text="${pageInfoUtil?.total }"></strong> 条
        </span>
    </div>
    <div class="mt-20">
        <div id="DataTables_Table_0_wrapper"
             class="dataTables_wrapper no-footer">
            <form id="formId" method="post" th:action="@{/back/adminsBack/adminsBatch}"
                  onsubmit="return vailForm('formId','ids')">
                    <span class="select-box inline">
                        操作类型:
                        <select name="operType" class="select">
                             <th:block th:each="enumsTemp: ${enumsOne?.enumsJson.getJSONArray('OPERTYPE')}">
                                <option th:value="${enumsTemp.code}" th:selected="${paramQuery.operType == enumsTemp.code}">
                                    <th:block th:text="${enumsTemp.info}"/>
                                </option>
                            </th:block>
                        </select>
                    </span>
                    <span class="select-box inline">
                        状态:
                        <select name="entity.status" class="select">
                             <th:block th:each="enumsTemp: ${enumsOne?.enumsJson.getJSONArray('STATUS')}">
                                <option th:value="${enumsTemp.code}" th:selected="${paramQuery.entity.status == enumsTemp.code}">
                                    <th:block th:text="${enumsTemp.info}"/>
                                </option>
                            </th:block>
                        </select>
                    </span>
                    <button name="" id="" class="btn btn-success" type="submit">
                        批量操作
                    </button>
                <table
                        class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                    <thead>
                    <tr class="text-c">
                        <th width="25">
                            <input type="checkbox" name="selectAll" id="selectAllId"
                                   onclick="return checkAllSelect('selectAllId','ids')"></th>
                        <th width="150">Id</th>
                        <th width="90">用户名</th>
                        <th width="90">昵称</th>
                        <th width="90">姓名</th>
                        <th width="90">手机</th>
                        <th width="80">状态</th>
                        <th width="80" title="删除标识">删除</th>
                        <th width="120">更新时间</th>
                        <th width="120">发布时间</th>
                        <th width="80">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <th:block th:each="oneTemp : ${dataList }">
                        <tr class="text-c">
                            <td><input type="checkbox" th:value="${oneTemp?.id }" name="ids"></td>
                            <td th:text="${oneTemp.id }"></td>
                            <td class="text-l">
                                <u style="cursor: pointer" class="text-primary" data-title="管理员查看" title="管理员查看"
                                   th:data-href="@{/back/adminsBack/adminsUpdate('entity.id'=${oneTemp.id })}"
                                   onclick="Hui_admin_tab(this)"
                                    th:text="${oneTemp.email }">
                                </u>
                            </td>
                            <td th:text="${oneTemp.nickName }"></td>
                            <td th:text="${oneTemp.name }"></td>
                            <td th:text="${oneTemp.phone }"></td>
                            <td class="td-status">
                                <span class="label label-success radius">
                                    <span class="label label-success radius" th:text="${oneTemp?.statusStr}">
                                    </span>
                                </span>
                            </td>
                            <td class="td-status">
                                <span class="label label-success radius">
                                    <span class="label label-success radius" th:text="${oneTemp?.delFlagStr}">
                                    </span>
                                </span>
                            </td>
                            <td th:text="${#dates.format(oneTemp.updateTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td th:text="${#dates.format(oneTemp.pubTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                            <td class="f-14 td-manage">
                                <a style="text-decoration: none" class="ml-5" data-title="管理员更新" title="管理员更新"
                                   th:data-href="@{/back/adminsBack/adminsUpdate(operType='updateInfo','entity.id'=${oneTemp.id })}"
                                   onclick="Hui_admin_tab(this)"
                                   href="javascript:;">
                                    <i class="Hui-iconfont">&#xe6df;</i>
                                </a>
                                <a style="text-decoration: none" class="ml-5" data-title="管理员重置密码" title="管理员重置密码"
                                   th:data-href="@{/back/adminsBack/adminsUpdate(operType='updateResetPass','entity.id'=${oneTemp.id })}"
                                   onclick="Hui_admin_tab(this)"
                                   href="javascript:;">
                                    <i class="Hui-iconfont">&#xe63f;</i>
                                </a>
                            </td>
                        </tr>
                    </th:block>
                    </tbody>
                </table>
            </form>
            <form id="pageForm" th:action="@{/back/adminsBack/adminsList}" method="post">
                <input type="hidden" name="keyword" th:value="${paramQuery.keyword}">
                <input type="hidden" name="entity.status" th:value="${paramQuery.entity.status}">
                <input type="hidden" name="entity.delFlag" th:value="${paramQuery.entity.delFlag}">
                <input type="hidden" name="stDate" th:value="${paramQuery.stDate}">
                <input type="hidden" name="edDate" th:value="${paramQuery.edDate}">
                <div class="dataTables_info" id="DataTables_Table_0_info"
                     role="status" aria-live="polite">共<span th:text="${pageInfoUtil?.pages}"></span>页，共<span
                        th:text="${pageInfoUtil?.total }"></span>条
                </div>
                <div class="dataTables_paginate paging_full_numbers"
                     id="DataTables_Table_0_paginate">
                    <a class="paginate_button first disabled"
                       aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0"
                       th:onclick="return pageFormSubmit('pageForm','current','1','size','[[${pageInfoUtil?.size}]]')"
                       id="DataTables_Table_0_first">首页</a>
                    <a class="paginate_button previous disabled"
                       aria-controls="DataTables_Table_0" data-dt-idx="1" tabindex="0"
                       th:onclick="return pageFormSubmit('pageForm','current','[[${pageInfoUtil?.current - 1}]]','size','[[${pageInfoUtil?.size}]]')"
                       id="DataTables_Table_0_previous">上一页</a>
                    <a class="paginate_button next" aria-controls="DataTables_Table_0"
                       th:onclick="return pageFormSubmit('pageForm','current','[[${pageInfoUtil?.current + 1}]]','size','[[${pageInfoUtil?.size}]]')"
                       data-dt-idx="4" tabindex="0" id="DataTables_Table_0_next">下一页</a>
                    <a class="paginate_button last" aria-controls="DataTables_Table_0"
                       th:onclick="return pageFormSubmit('pageForm','current','[[${pageInfoUtil?.total}]]','size','[[${pageInfoUtil?.size}]]')"
                       data-dt-idx="5" tabindex="0" id="DataTables_Table_0_last">尾页</a>
                    <span>
                        每<input class="paginate_button" type="text" id="current" name="current"
                                 th:value="${pageInfoUtil?.current}" size="5" maxlength="10">页
                        每页<input class="paginate_button" type="text" id="size" name="size"
                                   th:value="${pageInfoUtil?.size}" size="5" maxlength="10">条
                        <input class="paginate_button" type="submit" value="GO">
                    </span>
                </div>
            </form>
        </div>
    </div>
</div>
<footer th:replace="~{include/all_include ::  footer}"/>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript"
        th:src="@{/common/resource/H-ui.admin/lib/My97DatePicker/4.8/WdatePicker.js }"></script>
<script type="text/javascript"
        th:src="@{/common/resource/H-ui.admin/lib/datatables/1.10.15/jquery.dataTables.min.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/laypage/1.2/laypage.js}"></script>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/webuploader/0.1.5/webuploader.min.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.config.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.all.min.js}"> </script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js}"></script>
<script type="text/javascript">
    /*资讯-添加*/
    function article_add(title, url, w, h) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /*资讯-编辑*/
    function article_edit(title, url, id, w, h) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /*资讯-删除*/
    function article_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: '',
                dataType: 'json',
                success: function (data) {
                    $(obj).parents("tr").remove();
                    layer.msg('已删除!', {
                        icon: 1,
                        time: 1000
                    });
                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    }

    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        //表单验证
        $("#formId").validate({
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'post',
                    success: function(data){
                        console.log("==data==",data)
                        data = JSON.parse(data);
                        layer.msg(data.info,{icon:1,time:3000},function(){
                            /* 关闭当前窗口 */
                            if (data.code == '0') {
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.$('.btn-refresh').click();
                                parent.layer.close(index);

                                location.replace(location.href)
                                console.debug("===rvtf==")
                            }
                        });
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg('error!',{icon:1,time:1000});
                    }
                });
            }
        });
    });
</script>
</body>
</html>